package cn.supermaster.management.web.controller.system;

import javax.servlet.http.HttpServletResponse;

import cn.supermaster.management.web.service.system.ISIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import cn.supermaster.management.common.controller.BaseController;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 首页 业务处理
 */
@Controller
@RequestMapping("/")
public class SystemIndexController extends BaseController {

    @Autowired
    ISIndexService indexService;

    // 系统首页
    @GetMapping("/index")
    public String skipIndexHtml(ModelMap modelMap) {
        return indexService.skipIndexHtml(modelMap);
    }

    // 锁定屏幕
    @GetMapping("/lockscreen")
    public String skipLockscreenHtml(ModelMap modelMap) {
        return indexService.skipLockscreenHtml(modelMap);
    }

    // 切换主题
    @GetMapping("/system/switchSkin")
    public String skipSwitchSkinHtml() {
        return indexService.skipSwitchSkinHtml();
    }

    // 切换菜单
    @GetMapping("/system/menuStyle/{style}")
    public void skipMenuStyleHtml(@PathVariable String style, HttpServletResponse response) {
        indexService.skipMenuStyleHtml(response, style);
    }

    // 系统介绍
    @GetMapping("/system/main")
    public String skipMainHtml(ModelMap modelMap) {
        return indexService.skipMainHtml(modelMap);
    }
}
